import matplotlib.pyplot as plt
from sklearn.metrics import roc_curve, auc
import pandas as pd

fpr = dict()
tpr = dict()
roc_auc = dict()


# pd = pd.read_csv('svm.csv')
# rows = pd.shape[0]
#
# y_test = pd['y_test_truth']
# y_score = pd['y_predict_score']
#
# fpr, tpr, _ = roc_curve(y_test, y_score)
# roc_auc = auc(fpr, tpr)

list = ['Ids-MLP.csv', 'svm.csv', 'Ngram-TFIDF-MLP.csv', 'TFIDF-MLP.csv']
colors = ['aqua', 'darkorange', 'royalblue', 'm']
names = ['Ids-MLP', 'SVM', 'TFIDF-BAG-MLP', 'TFIDF-MLP']
for i in range(len(list)):
    y_test = pd.read_csv(list[i])['y_test_truth']
    y_score = pd.read_csv(list[i])['y_predict_score']
    fpr[i], tpr[i], _ = roc_curve(y_test, y_score)
    roc_auc[i] = auc(fpr[i], tpr[i])

plt.figure()
plt.tick_params(labelsize=18)
for i, color, name in zip(range(len(list)), colors, names):
    plt.plot(fpr[i], tpr[i], color=color, label= name + ' ROC Curve (area = %0.4f)' % roc_auc[i])

plt.plot([0, 1], [0, 1], color='navy', linestyle='--')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate', fontsize=15 )
plt.ylabel('True Positive Rate', fontsize=15)
plt.legend(loc="lower right", fontsize=20)
plt.show()